package cn.tedu.study.notemodel.controller;

import cn.tedu.study.notemodel.mapper.SubjectMapper;
import cn.tedu.study.response.ResultVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/v1/subject/")
public class SubjectController {
    @Autowired
    private SubjectMapper subjectMapper;

    @RequestMapping("selectSubject")
    public ResultVO selectSubject() {
        System.out.println(subjectMapper.selectSubject());
        return ResultVO.ok(subjectMapper.selectSubject());
    }

    @RequestMapping("/delete/{id}")
    public ResultVO delete(@PathVariable Integer id){
        subjectMapper.delete(id);
        return ResultVO.ok();
    }
}
